import React, { Component } from 'react'
import './style.css'

export default class ChildClickCounter extends Component {

  state={
    count:0
  }

  add = ()=>{
    this.setState({count:this.state.count+1});
  }

  render() {
    return (
     <div className="child">
        <h3>ClickCounter子组件</h3>
        <button onClick={this.add}>当前点击次数:{this.state.count}</button>
     </div>
    )
  }
}
